<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="../build/jsMotif.js"></script>
        
        <title>jsMotif example</title>
    </head>
    <body>

        <div id="template">
            <ul each="{results}">
                <li>
                    <span fill={properties.title}></span>
                    <span fill={properties.addrCityName}></span>
                </li>
            </ul>
        </div>

        <script type="text/javascript">
           
            var tpl = new jsMotif.Template({
                template: 'template',
                targetNode: 'template'
            });
           
           //JSONP (cross domain) request, use reqType: 'jsonp' and use {CB_FN} in the url to mark place where callback function name should be placed
           tpl.renderJSON('http://where.desktop.mos.svc.ovi.com/NOSe/json?dv=oviMaps&la=en-gb&cbfn={CB_FN}&app_id=&token=&vi=where&q=pizza&lon=13.377678&lat=52.516274&rid=oe79EqeR', 
           {
               reqType: 'jsonp',
               timeout: 5000
           });
           
           //XMLHTTPREQUEST possible to add timeout and custom headers to request
           /*
           tpl.renderJSON('data.json', {
               timeout: 5000,
               headers: {
                   'myHeader': 'myHeaderValue'
               }
           });
           */
           
                
        </script>
        
    </body>
</html>
